package wnhz.com.business.shareshop.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.WindowManager;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import wnhz.com.business.R;
import wnhz.com.business.base.BaseActivity;
import wnhz.com.business.base.BaseRVAdapter;
import wnhz.com.business.base.BaseViewHolder;
import wnhz.com.business.groupshop.ui.ShangpinActivity;
import wnhz.com.business.impl.ActionBarClickListener;
import wnhz.com.business.view.TranslucentActionBar;

/**
 * 商品发布最后展示
 */
public class ShangpinSendEActivityS extends BaseActivity implements ActionBarClickListener {

    @BindView(R.id.actionbar)
    TranslucentActionBar actionbar;
    @BindView(R.id.recycler_datat)
    RecyclerView recyclerDatat;

    private List<String> itemda = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shangpin_send_es);
        ButterKnife.bind(this);
        actionbar.setData("商品发布", R.drawable.ic_lefft_white, null,0, "发布", 0, this);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            actionbar.setStatusBarHeight(getStatusBarHeight());
        }

        initview();
        setdata();

    }

    public static Intent createIntent(Context context) {
        Intent intent = new Intent(context, ShangpinSendEActivityS.class);
        return intent;
    }

    private void initview()
    {
        recyclerDatat.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
        itemda.clear();
        for (int i = 0; i <4 ; i++) {
            itemda.add("gf"+i);
        }
    }

    private void setdata(){
        recyclerDatat.setAdapter(new BaseRVAdapter(this,itemda) {
            @Override
            public int getLayoutId(int viewType) {
                return R.layout.item_shangpinend;
            }

            @Override
            public void onBind(BaseViewHolder holder, int position) {

            }

        });
    }

    @Override
    public void onLeftClick() {
        finish();
    }

    @Override
    public void onRightClick() {
        startActivity(ShangpinActivityS.createIntent(this));
    }

    @Override
    public void onEditTextClick() {



    }
}
